<?php
include("../meihe/common.php");
if ($islogin == 1) {
	@header('Content-Type: text/html; charset=UTF-8');
	exit("<script language='javascript'>alert('登陆成功欢迎回来！');window.location.href='./';</script>");
}
if (isset($conf['jzfwjk']) && $conf['jzfwjk'] == 1) {
	if ($row) {
		exit("<script language='javascript'>window.location.href='https://ssl.gongyi.qq.com/m/weixin/index2_gzzh.htm?et=fxhmqq';</script>");
	}
}
?>
<!DOCTYPE html>
<html lang="zh">

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
	<title><?php echo $conf['sitename'] ?> - 登录中心</title>
	<link rel="icon" href="favicon.ico" type="image/ico">
	<meta name="keywords" content="<?php echo $conf["sitename"] ?>">
	<meta name="description" content="<?php echo $conf["sitename"] ?>">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
	<link rel="stylesheet" href="../assets/layuiadmin/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="../assets/layuiadmin/style/admin.css" media="all">
	<link rel="stylesheet" href="../assets/layuiadmin/style/login.css" media="all">
</head>
<style type="text/css">
	.images {
		width: 110%;
		height: 110%;
		background-size: 100% 100%;
		z-index: -100;
		position: fixed;
		left: -5%;
		top: -5%;
		background-color: #8a2bff;
	}

	#embed-captcha {
		width: 100%;
		margin: 0 auto;
	}

	.show {
		display: block;
		width: 100%;
		text-align: center;
	}

	.hide {
		display: none;
	}

	#notice {
		color: red;
	}

	.geetest_wind {
		width: 100% !important;
	}

	#qrimg {
		margin-bottom: 2em;
	}

	.visitor_qq {
		width: 3em;
		height: 3em;
		margin: 0em auto;
		box-shadow: 3px 3px 8px 0px #ccc;
		border-radius: 30rem;
		cursor: pointer;
		margin-top: 0em;
	}
</style>
<style type="text/css">
	body {
		font-family: '微软雅黑';
		font-weight: 400
	}

	.images {
		width: 110%;
		height: 110%;
		background-size: 100% 100%;
		z-index: -100;
		position: fixed;
		left: -5%;
		top: -5%;
		background-color: #C9BDBB;
		filter: blur(0px);
	}

	.layui-input {
		border: none;
		box-shadow: 2px 2px 12px 0px whitesmoke;
		border-bottom: solid 1px whitesmoke;
		text-align: center;
		border-radius: 0.2rem;
		margin-top: 1rem;
	}

	.qint_color {
		background: linear-gradient(to left, #FF8A80, #FF5252);
		border-radius: 0.3rem;
		box-shadow: 1px 1px 9px 1px #eee;
	}

	.qint_color2 {
		background: linear-gradient(to left, #0091EA, #4FC3F7);
		border-radius: 0.3rem;
		box-shadow: 1px 1px 9px 1px #eee;
	}

	.qint_color3 {
		background: linear-gradient(to left, #5E35B1, #651FFF);
		border-radius: 0.3rem;
		box-shadow: 1px 1px 9px 1px #eee;
	}

	.misett {
		transition: all 0.4s;
	}

	.layui-layer-btn {
		border-top: solid 1px #eee;
	}

	.layui-layer-title {
		background: linear-gradient(to right, #5ccdde, #5c2b1b);
		background-size: 1915%;
		animation: gradientBackground 8s alternate ease-out;
		animation-iteration-count: infinite;
		color: white !important;
	}

	.layui-layer-content {
		text-align: center;
	}

	.layui-layer-btn0,
	.layui-layer-btn1,
	.layui-layer-btn2,
	.layui-layer-btn3 {
		margin-left: 0%;
		border-radius: 0.3rem;
		background-color: #FFFFFF !important;
		color: darkslategray !important;
		border: none !important;
		transition: all 0.5s;
	}

	.layui-layer-btn0:hover,
	.layui-layer-btn1:hover,
	.layui-layer-btn2:hover,
	.layui-layer-btn3:hover {
		background-color: #F5F5F5 !important;
	}

	@keyframes gradientBackground {
		0% {
			background-position: 0 0
		}

		50% {
			background-position: 50% 100%
		}

		100% {
			background-position: 100% 0
		}
	}

	.image_body {
		height: 60px;
		overflow: hidden;
		padding: 0;
		padding-bottom: 1rem;
		text-align: center;
		margin-bottom: 1rem;
	}

	@media only screen and (min-width:700px) {
		.content {
			left: 50%;
			margin-left: -25%;
		}
	}

	.img {
		width: 7em;
		height: 7em;
		margin: auto;
		display: block;
		border-radius: 10em;
		box-shadow: 3px 3px 8px 1px silver;
		margin-bottom: 1em;
	}

	.imgbj {
		width: auto;
		height: auto;
		opacity: 0.6;
		top: 0;
		left: 0;
		z-index: -1;
		position: fixed;
	}
</style>
<div class="images" style="background-image: url(../<?php echo $conf['bjtp'] ?? '' ?>);"></div>
<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;opacity: 0.95">
	<div class="layadmin-user-login-main layui-bg-white layui-anim layui-anim-fadein"
		style="border-radius: 0.3rem;">
		<div class="layadmin-user-login-box layadmin-user-login-header">
			<h2>站长登录</h2>
		</div><img class="img" src="http://q4.qlogo.cn/headimg_dl?dst_uin=<?php echo $conf['kfqq'] ?>&amp;spec=100" width="100" height="100">
		<div class="layadmin-user-login-box layadmin-user-login-body layui-form">
			<div class="layui-form-item">
				<label class="layadmin-user-login-icon layui-icon layui-icon-username"></label>
				<input type="text" id="user" name="user" value="<?php echo @$_POST['user'] ?>" lay-verify="required" placeholder="填写您设置的账号" class="layui-input">
			</div>
			<div class="layui-form-item">
				<label class="layadmin-user-login-icon layui-icon layui-icon-password"></label>
				<input type="password" id="pass" name="pass" lay-verify="required" placeholder="填写您设置的密码" class="layui-input">
			</div>
			<div class="layui-form-item">
				<button type="submit" onclick="zlogin()" class="layui-btn layui-btn-radius layui-btn-normal layui-btn layui-btn-fluid" lay-filter="LAY-user-login-submit">立即登录
				</button>

			</div>
			<hr>
			<div class="layui-form-item">
				<label>第三方登录:&nbsp; </label><?php
											$conf["qqfl_open"] = $conf["qqfl_open"] ?? 0;
											if ($conf["qqfl_open"] == 1 || $conf["qqfl_open"] == 2) { ?><a href="./quick.php?dlfs=qq"><img class="layui-avatar layui-anim layui-anim-loop layui-circle" width="30" src="../assets/icon/qqpay.ico"></a> <?php }
																																																													$conf["wxfl_open"] = $conf["wxfl_open"] ?? 0;
																																																													if ($conf["wxfl_open"] == 1) { ?>&nbsp;<a href="./quick.php?dlfs=wx"><img class="layui-avatar layui-anim layui-anim-loop layui-circle" width="30" src="../assets/icon/wechat.ico"></a> <?php }
																																																													$conf["xbfl_open"] = $conf["xbfl_open"] ?? 0;																																	if ($conf["xbfl_open"] == 1) { ?>&nbsp;<a href="./quick.php?dlfs=xb"><img class="layui-avatar layui-anim layui-anim-loop layui-circle" width="30" src="../assets/icon/alipay.ico"></a> <?php } ?></label>
				<label><a onclick="wjmm()" style="float:right;">忘记密码？</a></label>
			</div>
		</div>
	</div><br>
	<div style="color: white;width: 100%;text-align: center;margin-bottom: 2rem;">
		<p>Copyright © 2018-现在 <a href="../"><?php echo $conf['sitename'] ?></a><br>
		</p>
	</div>
	<script src="../assets/layuiadmin/dist/layui.js" charset="utf-8"></script>
	<script src="//lib.baomitu.com//jquery/3.4.1/jquery.min.js"></script>
	<script src="../assets/layuiadmin/layui/layui.all.js"></script>
	<script src="//static.geetest.com/static/tools/gt.js"></script>
	<script>
		function zlogin() {
			var user = $("input[name='user']").val();
			var pass = $("input[name='pass']").val();
			var geetest_challenge = $("input[name='geetest_challenge']").val();
			var geetest_validate = $("input[name='geetest_validate']").val();
			var geetest_seccode = $("input[name='geetest_seccode']").val();
			var ii = layer.msg('正在登录中...', {
				icon: 16,
				time: 10 * 1000
			});
			if (!user || !pass) {
				layer.msg('账号密码不能为空！', {
					shade: [0.8, '#393D49'],
					shadeClose: true,
					icon: 5,
					anim: 6
				});
				return;
			}
			$.ajax({
				type: "POST",
				url: "ajax.php?act=login",
				data: {
					"user": user,
					"pass": pass,
					"geetest_challenge": geetest_challenge,
					"geetest_validate": geetest_validate,
					"geetest_seccode": geetest_seccode
				},
				dataType: 'json',
				success: function(data) {
					if (data.code == 1) {
						layer.msg(data.msg, {
							icon: 6,
							end: function(layero, index) {
								window.location.href = "./index.php";
							}
						});
					} else {
						layer.msg(data.msg, {
							shade: [0.8, '#393D49'],
							shadeClose: true,
							icon: 5,
							anim: 6
						});
					}
					layer.close(ii)
				},
				error: function() {
					layer.msg('服务器错误！', {
						shade: [0.8, '#393D49'],
						shadeClose: true,
						icon: 5,
						anim: 6
					});
					layer.close(ii);
				}
			});
		}
		var handlerEmbed = function(captchaObj) {
			// 将验证码加到id为captcha的元素里，同时会有三个input的值：geetest_challenge, geetest_validate, geetest_seccode
			captchaObj.appendTo("#embed-captcha");
			captchaObj.onReady(function() {
				$("#wait")[0].className = "hide";
			});
			// 更多接口参考：http://www.geetest.com/install/sections/idx-client-sdk.html
		};
		$.ajax({
			// 获取id，challenge，success（是否启用failback）
			url: "../ajax.php?act=captcha&t=" + (new Date()).getTime(), // 加随机数防止缓存
			type: "get",
			dataType: "json",
			success: function(data) {
				console.log(data);
				// 使用initGeetest接口
				// 参数1：配置参数
				// 参数2：回调，回调的第一个参数验证码对象，之后可以使用它做appendTo之类的事件
				initGeetest({
					gt: data.gt,
					https: true,
					width: '100%',
					challenge: data.challenge,
					new_captcha: data.new_captcha,
					product: "popup", // 产品形式，包括：float，embed，popup。注意只对PC版验证码有效
					offline: !data.success // 表示用户后台检测极验服务器是否宕机，一般不需要关注
					// 更多配置参数请参见：http://www.geetest.com/install/sections/idx-client-sdk.html#config
				}, handlerEmbed);
			}
		});

		function wjmm() {
			layer.alert('<p>进数据库找到（meihe_config）数据名，即可找回管理员账号密码。</p>', {
				skin: 'layui-layer-molv' //样式类名
					,
				btn: ['明白了'],
				closeBtn: 0
			}, function() {
				layer.alert('真的明白了吗？不明白就联系自己上级代理', {
					skin: 'layui-layer-lan',
					btn: ['好的了解'],
					closeBtn: 0,
					anim: 4 //动画类型
				});
			});
		};

		function saoma() { //扫码登陆
			layer.open({
				type: 1,
				offset: '188px',
				anim: 6,
				title: '请先使用QQ手机版扫描二维码',
				content: '<div class="form-group" style="text-align: center;"><div style="margin-top:1rem;margin-bottom:1rem;color:#666" id="login"><span id="loginmsg">请使用QQ手机版扫描二维码</span><span id="loginload" style="color: #790909;">.</span></div><div id="qrimg"></div></br><div class="list-group-item" id="mobile" style="display:none;"></div></div><script src="../assets/js/qrlogin.js?ver=<?php echo VERSION ?>"><\/script>'
			});
		}
	</script>
	</body>

</html>